package com.ifeiyang.bijia.model;

import zback._Test;

import com.lidroid.xutils.HttpUtils;
import com.lidroid.xutils.http.RequestParams;
import com.lidroid.xutils.http.callback.RequestCallBack;
import com.lidroid.xutils.http.client.HttpRequest;

public class HttpModel
{

	private RequestCallBack<String> callBack;

	public void loadTestProduct()
	{

		if (_Test.test())
		{
			HttpUtils http = new HttpUtils();
			String url = "http://appservice.iflying.com/Get/ClusterList.ashx?&Size=2&page=1&ProductType=2&DepartID=1&StrMd5=690128A2418E1049CA5C97E3B475B9C8&productID=215461&DestinationID=579";
			http.send(HttpRequest.HttpMethod.GET, url, callBack);
		}
		else
		{
			HttpUtils http = new HttpUtils();
			RequestParams params = new RequestParams();
			params.addQueryStringParameter("StrMd5", "690128A2418E1049CA5C97E3B475B9C8");
			params.addQueryStringParameter("Day", "");
			params.addQueryStringParameter("Price", "");
			params.addQueryStringParameter("StringLike", "");
			params.addQueryStringParameter("DepartID", "1");
			params.addQueryStringParameter("DestinationID", "579");
			params.addQueryStringParameter("Sort", "1");
			params.addQueryStringParameter("Page", "1");
			params.addQueryStringParameter("Size", "10");
			params.addQueryStringParameter("ProductType", "2");
			params.addQueryStringParameter("State", "1");
			String url = "http://appservice.iflying.com/Get/ClusterList.ashx";
			http.send(HttpRequest.HttpMethod.GET, url, callBack);

		}
	}

	public void setRequestCallBack(RequestCallBack<String> callBack)
	{
		this.callBack = callBack;

	}

}
